#ifndef IPHONEWINDOW_H
#define IPHONEWINDOW_H

#include <QWidget>
#include <QPainter>
#include <QStyleOptionTitleBar>
#include "post.h"
#include <QMainWindow>

class QListWidget;
class QLineEdit;
class QBoxLayout;


class IphoneWindow : public QWidget
{
public:
    IphoneWindow(QWidget *parent = nullptr);
    //bool IsCustomControl(QWidget* widget);
    void DeleteAll(); //清除当前页面
    void StartHomePage(); // 加载首页
    void StartPost(); // 加载论坛页
    void loadMenuButtons(); //加载关闭、最小化按钮
protected:
    void paintEvent(QPaintEvent *event) override;
    void mousePressEvent(QMouseEvent *event) override;
    void mouseMoveEvent(QMouseEvent *event) override;

public slots:
    void addPost();
    void likePost(Post *post);
    void replyPost(Post *post);

public:
    QWidget *MenuButtons;

private:
    QListWidget *m_postList;
    QPoint MDragStartPosition;     // 记录拖动开始的鼠标位置
    QPoint MDragWindowPosition;    // 记录拖动开始时的窗口位置
};

#endif // IPHONEWINDOW_H
